import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['SimHei']  # 设置中文字体

# 数据设置
years = list(range(2024, 2031))
profits_case_1 = [6145805, 6036457, 6042181, 6049573, 5989339, 6077758, 6136180]
profits_case_2 = [6795924, 6063617, 6524089, 6351406, 6199741, 6306033, 6368757]
profits_case_3 = [6347001, 6181880, 6209923, 6437937, 6374439, 5983297, 6279314]
profits_case_4 = [6415830, 6440038, 6435561, 6490938, 6517077, 6529006, 6631011]
fixed_profit_2023 = 5968077

# 绘制折线图
plt.figure(figsize=(10, 6), dpi=200)
plt.plot(years, profits_case_1, label='result1_1', marker='o', color='darkblue')  # 深蓝色
plt.plot(years, profits_case_2, label='result1_2', marker='o', color='darkgreen')  # 深绿色
plt.plot(years, profits_case_3, label='result2', marker='o', color='magenta')  # 品红色
plt.plot(years, profits_case_4, label='result3', marker='o', color='goldenrod')  # 金菊黄
plt.axhline(y=fixed_profit_2023, color='grey', linestyle='--', label='2023年总利润')  # 灰色参考线

# 设置y轴范围
plt.ylim(4000000, 7500000)

plt.title('2024至2030年各情况总利润')
plt.xlabel('年份')
plt.ylabel('总利润（元）')
plt.legend()
plt.grid(True)
plt.show()
